package com.yupi.mybi.bimq;

import com.yupi.mybi.constant.MqConstant;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Component
public class BiMessageProducer {

    @Resource
    private RabbitTemplate rabbitTemplate;


    /**
     * 发送消息
     * @param message
     */
    public void sendMessage(String message){
        rabbitTemplate.convertAndSend(MqConstant.BI_EXCHANGE, MqConstant.BI_ROUTING_KEY, message);
    }

    public void sendDlxMessage(String message){
        rabbitTemplate.convertAndSend(BiConstant.WORK_EXCHANGE, BiConstant.WORK_ROUTINGKEY, message);
    }
}
